home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
comm
/
bbs
/
MAX_DoorPack.lha
/
MAX_DoorPack103
/
DoorPack.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-12
|
16KB
|
635 lines
/*
$VER: doorpack.h 1.03 (20.02.95)
Fixed and updated by Marcin Orlowski
*/
#define CAR if(doormsg->carrier==1) return;
#define DROP if(doormsg->carrier==1) end();
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <exec/types.h>
#include <exec/ports.h>
extern void end( void );
extern void getsvar( int typ, char *mstring );
extern void sendmessage( char mstring[], int nl );
extern void hotkey( char mstring[], char *ostring );
extern void prompt( char mstring[], char *ostring, int len );
extern void sprompt( char mstring[], char *ostring, int len );
extern void showfile( char mstring[] );
extern void twituser( void );
extern void addtime( int howmuch );
extern void newaccess( int now );
extern void MenuFunction( int function, int extra, char *string );
extern void localmessage( char mstring[], int nl );
extern void putmodemchar( char outd );
extern void putscreenchar( char outd );
extern void putdoorchar( char outd );
extern void editfile( char mstring[], int maxlines );
extern int chkfile( char *filename );
extern int getsnum( int typ );
extern int ReadStructure( FILE *fp, char *structure, int length );
extern int WriteStructure( FILE *fp, char *structure, int length );
extern struct Task *mytask; /* Pointer to this task so we can name it */
void dmain( void );
/*
The following code was kindly supplied by Robert Masters. It deals with
the MAX's configuration files, as outlined in the #?.text ascii files
included in this archive.
*/
#define MAXS_BBS 1.52
#define HEADER_STRING "M A X's BBS Version 1.52 Copyright . 1992 by Anthony Barrett"
#define HEADER_LENGTH 62
struct Section {
char name[42];
LONG low_access,
high_access,
reply_access,
max_count;
ULONG not_used :23,
flag_echo :1,
flag_files :1,
flag_alias :1,
flag_lk3 :1,
flag_lk2 :1,
flag_lk1 :1,
flag_del :1,
flag_to :1,
flag_frm :1;
};
struct Fido
{
UBYTE section_number;
UBYTE flag_LZH :1,
flag_old_filename :1;
char area_name[40];
USHORT dest_zone,
dest_net,
dest_node,
dest_point;
char password[8];
USHORT opt_bbs_zone,
opt_bbs_net,
opt_bbs_node,
opt_bbs_point;
char origin_line[58];
};
struct Menu
{
UBYTE key;
ULONG function,
extra,
low_access,
high_access;
char string[41];
};
struct Config
{
char header[HEADER_LENGTH-1]; /*don't ask me why it's short one*/
UBYTE new_files_public :1,
esc_control_chars :1,
flashing_text :1,
interlace :1,
zmodem_XON_XOFF :1,
iconify_on_start :1,
zmodem_resume :1,
show_connect_info :1;
char text_files_path[41],
user_files_path[41],
message_files_path[41],
files_files_path[42],
log_files_path[41],
bell_sample_filename[41],
chat_sample_filename[41];
ULONG bell_sample_play_rate,
chat_sample_play_rate,
max_users,
max_file_size,
logsize,
upload_reward,
sleep_time,
countdown_time,
chat_on_time,
chat_off_time,
max_chat_pages,
ud_on_time,
ud_off_time,
dimmer_time,
max_time,
min_upload_space,
add_sub_value,
optimize_messages_time,
login_time_limit,
answer_delay,
iconify_position,
inactive_days;
char door_files_path[41];
char opt_files_paths[30][41];
UBYTE modem_blank :3,
add_ul_reward :1,
freeze_ul_clock :1,
monochrome_display:1,
update_dl_log :1,
update_cli_log :1;
USHORT clock_window_position_x;
USHORT clock_window_position_y;
char attached_files_path[41],
bbs_font_filename[41],
window_font_filename[41],
execute_logoff_filename[41];
ULONG attached_files_old_days,
max_bps,
min_bps;
char modem_setup[41],
_300_connect[41],
_600_connect[41],
_1200_connect[41],
_2400_connect[41],
_4800_connect[41],
_9600_connect[41],
_19200_connect[41],
_38400_connect[41],
busy[41],
no_dial_tone[41],
device_name[27];
ULONG serial_blank :27,
auto_connect :1,
slow_command :1,
send_setup_twice :1,
locked_bps_rate :1,
_7_wire_handshake :1;
UWORD serial_dev_unit; /* Here the bugs was */
char _12000_connect[41],
_14400_connect[41];
ULONG guest_blank :27,
guest_afa :1,
guest_dn :1,
guest_up :1,
guest_wr :1,
guest_rd :1;
ULONG member_blank :27,
member_afa :1,
member_dn :1,
member_up :1,
member_wr :1,
member_rd :1;
ULONG guest_access_level,
guest_time_limit,
guest_ratio,
guest_max_time_bank,
member_access_level,
member_time_limit,
member_ratio,
member_max_time_bank;
struct Section section[100];
char text_strings[350][100],
macro_strings[20][100],
fido_inbound_path[42],
fido_outbound_path[42],
fido_origin_line[58],
fido_bbs_name[60];
USHORT bbs_address_zone,
bbs_address_net,
bbs_address_node,
bbs_address_point;
char sysop_name[20],
make_LZH_string[41],
unLZH_string[41],
phone_number_dial[21][41],
execute_program_string[21][41];
ULONG phone_number_dial_time[21],
execute_program_time[21];
char phone_number_day_count[21],
execute_program_day_count[21];
ULONG dial_blank :11,
dial_flags_phone_21 :1,
dial_flags_phone_20 :1,
dial_flags_phone_19 :1,
dial_flags_phone_18 :1,
dial_flags_phone_17 :1,
dial_flags_phone_16 :1,
dial_flags_phone_15 :1,
dial_flags_phone_14 :1,
dial_flags_phone_13 :1,
dial_flags_phone_12 :1,
dial_flags_phone_11 :1,
dial_flags_phone_10 :1,
dial_flags_phone_9 :1,
dial_flags_phone_8 :1,
dial_flags_phone_7 :1,
dial_flags_phone_6 :1,
dial_flags_phone_5 :1,
dial_flags_phone_4 :1,
dial_flags_phone_3 :1,
dial_flags_phone_2 :1,
dial_flags_phone_1 :1;
ULONG execute_blank :11,
execute_flags_21 :1,
execute_flags_20 :1,
execute_flags_19 :1,
execute_flags_18 :1,
execute_flags_17 :1,
execute_flags_16 :1,
execute_flags_15 :1,
execute_flags_14 :1,
execute_flags_13 :1,
execute_flags_12 :1,
execute_flags_11 :1,
execute_flags_10 :1,
execute_flags_9 :1,
execute_flags_8 :1,
execute_flags_7 :1,
execute_flags_6 :1,
execute_flags_5 :1,
execute_flags_4 :1,
execute_flags_3 :1,
execute_flags_2 :1,
execute_flags_1 :1;
ULONG max_retries,
time_out,
redial_delay,
fido_on_time,
fido_off_time,
message_import_time;
ULONG fido_blank :22,
no_care_import :1,
update_log :1,
show_cntrl_info :1,
fidonet_only :1,
allow_waZOO :1,
allow_telink :1,
allow_send :1,
allow_pickup :1,
auto_execute :1,
auto_fidonet :1;
struct Fido fido[200];
};
struct Config_Menus
{
ULONG menu_number;
char text_filename[41];
struct Menu menu[10];
};
/* After reading the Config, keep reading Config_Menus until the end of
the file. There may be more than 1 * 10 Menu structs per menu_number..*/
struct File_Data_Header
{
UBYTE header[HEADER_LENGTH];
ULONG total_active,
section_count[100];
};
struct File_Data
{
ULONG date,
time,
length,
downloads;
UBYTE not_used_A :4,
flag_gone :1,
flag_new :1,
flag_lock :1,
flag_del :1;
UBYTE section_number,
filename[41],
description[60],
from[41],
from_alias[41],
from_node;
};
struct File_Index_Header
{
UBYTE header[HEADER_LENGTH];
};
struct File_Index
{
UBYTE filename[41],
section_number,
not_used_A :5,
flag_new :1,
flag_lock :1,
flag_del :1,
reserved;
};
struct Log_Data_Header
{
UBYTE header[HEADER_LENGTH];
ULONG total_active,
start;
};
struct Log_Data
{
UBYTE name[41],
exit_code; /* use enum Exit_Code */
ULONG logged_on_days,
logged_on_mins,
logged_off_days,
logged_off_mins;
USHORT messages_read,
messages_left,
uploads,
downloads,
baud_rate,
not_used_A :14,
flag_cli :1,
flag_paged :1;
};
enum Exit_Code
{
Normal, Slow_baud_rate, Userfile_full, Lost_carrier,
Security_violation, Locked_out, Out_of_time, Sleep_disconnect,
Twited, DOS_read_error, DOS_write_error, Low_mem_error,
System_event, Forced_hangup, Slow_login, Reserved_BBS
};
struct Message_Data_Header
{
UBYTE header[HEADER_LENGTH];
ULONG total_active,
highest,
section_count[100];
};
struct Message_Data
{
ULONG message_number,
date,
time,
previous;
USHORT replies;
ULONG position;
USHORT length,
length_space,
not_used_A :9,
flag_netmail :1,
flag_file_attach :1,
flag_import :1,
flag_forward :1,
flag_locked :1,
flag_received :1,
flag_del :1;
UBYTE section_number,
from[41],
to[41],
subject[72],
from_alias[41],
to_alias[41],
pad;
USHORT orig_node,
dest_node,
orig_net,
dest_net;
};
struct Message_Index_Header
{
UBYTE header[HEADER_LENGTH];
};
struct Message_Index
{
ULONG message_number;
UBYTE section_number,
not_used_A :7,
flag_del :1;
};
struct User_Data_Header
{
UBYTE header[HEADER_LENGTH];
ULONG total_calls;
};
struct User_Data
{
UBYTE name[41],
suburb[40],
password[21],
phone[21],
computer[21],
comment[100];
ULONG time_remain,
access_level,
time_limit,
du_ratio,
last_message_read,
page_length,
calls,
messages,
uploads,
downloads,
last_date_on,
last_time_on,
not_used_A :19,
flag_file_attach :1,
flag_junk_mail :1,
flag_file_desc :1,
flag_lck :1,
flag_cls :1,
flag_pause :1,
flag_fse :1,
flag_ansi :1,
flag_bltn :1,
flag_dn :1,
flag_up :1,
flag_wr :1,
flag_rd :1,
time_bank,
transfer_protocol,
max_time_bank;
};
struct User_Index_Header
{
UBYTE header[HEADER_LENGTH];
};
struct User_Index
{
UBYTE name[41];
};
/* This is included here just as a place for putting it, but this is the
structure for the data file in my program 'Section_Path'. As several of my
programs use this data file, I have put the structure here should anyone
else wish to use it as a quick way of cross refrencing sections to paths.
There are some blanks in the struct that will not be used, they were only
there for some future expansion. */
struct Section_Path_Data
{
char section[101], /* the path no. that each section uses. 127 if not used */
path[101][81], /* path names as from FilePaths.text */
files[80]; /* path to the File.data ect. */
};
/* These are for use with the MasterPort functions of MAXs */
struct MultiStruct
{
LONG totalcalls;
LONG totalusers;
LONG activemessages;
LONG highestmessage;
LONG lowestmessage;
LONG activefiles;
LONG msgindexpointer;
LONG msgindexsize;
LONG fileindexpointer;
LONG fileindexsize;
LONG numbernodes;
LONG onlineusers;
};
struct _DoorMsg
{
struct Message Door_Msg;
short command;
short data;
char string[80];
short carrier;
};
struct MasterPort
{
struct Message _Door_Msg;
WORD command;
LONG data;
char string[80];
short carrier;
};
/* arguments for getsvar()function */
#define GETS_USERNAME 1
#define GETS_PASSWORD 2
#define GETS_SUBURB 3
#define GETS_CITY 4
#define GETS_STATE 5
#define GETS_POSTCODE 6
#define GETS_DOORPATH 7
#define GETS_MAINPATH 8
#define GETS_DATE 9
#define GETS_TIME 10
#define GETS_PHONE 100
#define GETS_COMPUTER 101
#define GETS_COMMENT 102
/* arguments for getsnum()function */
#define GETN_ACCESS 1
#define GETN_EXPERTMODE 2
#define GETN_CREDITS 3
#define GETN_CALLS 4
#define GETN_SYSCALLS 5
#define GETN_GFXMODE 6
#define GETN_TIMEREMAIN 7
#define GETN_COLUMNS 8
#define GETN_ROWS 9